<template>
	<view class="page">
		<view class="bar_info" :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class="title_bar">
				<view class="title_bar_left" @tap.stop="handleJump" data-type="BACK">
					<image class="title_bar_left_icon" :src='STATIC_URL+"5.png"'></image>
				</view>
				<view class="title_bar_center">
					退货订单
				</view>
				<view class="title_bar_right"></view>
			</view>
		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		
		<view class="list">
			<view class="list_item">
				<view class="return_price">
					<text class="return_price_1">退货总金额：</text>
					<text class="return_price_2">￥11.00</text>
				</view>
				<view class="order_price">
					<text style="margin-right: 48rpx;">订单金额：￥11.00</text>
					<text>订单编号：SXYS12015254441</text>
				</view>
				<view class="return_shop flex justify-between">
					<view class="shop_price">
						<u-lazy-load :image="image" img-mode="aspectFill" height="120" border-radius="8"></u-lazy-load>
						<view class="return_text flex align-center justify-center">退款成功</view>
					</view>
					<view class="return_information">
						<view class="return_price">
							<text class="return_price_1">退货金额：</text>
							<text class="return_price_2">￥11.00</text>
						</view>
						<view class="apply_time">申请时间：2024-01-01 10:00</view>
					</view>
					<view class="details_btn flex align-center justify-center" @tap.stop="handleJump" data-type="navigateTo" :data-url="`/pages/my/returnDetails`">订单详情</view>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		data() {
			return {
				image: '/static/index/3.png',
				list: [],
				"page": 1,
				"is_pull": true,
				"last_page": 1,
				"status": 'loadmore',
				"iconType": 'flower',
				"loadText": {
					loadmore: '轻轻上拉',
					loading: '努力加载中',
					nomore: '我也是有底线的'
				},
			}
		},
		onLoad() {
			
		},
		onShow() {
			this.page = 1;
			this.is_pull = true;
			this.isShow = true;
			this.getOrder();
		},
		// 下拉刷新
		onPullDownRefresh() {
			this.page = 1;
			this.is_pull = true;
			this.isShow = true;
			this.getOrder();
		},
		// 上拉加载
		onReachBottom() {
			if (this.page >= this.last_page) return;
			this.status = 'loading';
			this.page++;
			setTimeout(() => {
		
				if (this.page >= this.last_page) this.status = 'nomore';
				else this.status = 'loading';
				this.is_pull = false;
				this.getOrder();
			}, 500)
		},
		methods: {
			getOrder() {
				this.$api.get(global.apiUrls.gylOrder, {
					page: this.page,
					pageSize: 10,
					status: 7
				}).then(res => {
					console.log(res);
					uni.stopPullDownRefresh();
					this.isShow = false;
					if (res.data.code == 200) {
						this.last_page = res.data.data.pageInfo.totalPage;
						if (this.is_pull) {
							this.list = res.data.data.items;
						} else {
							this.list = this.list.concat(res.data.data.items);
						}
					} else {
						this.$message.info(res.data.message);
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		background: #f5f5f5;
		background-size: 100% auto !important;
		.bar_info {
			width: 750rpx;
			height: 88rpx;
			overflow: hidden;
			z-index: 10;
			position: fixed;
			top: 0rpx;
		
			.title_bar {
				padding: 0 32rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
		
				.title_bar_left {
					width: 50rpx;
					.title_bar_left_icon {
						width: 18rpx;
						height: 32rpx;
					}
				}
		
				.title_bar_center {
					line-height: 88rpx;
					font-size: 36rpx;
					font-weight: 400;
				}
		
				.title_bar_right {
					width: 50rpx;
				}
			}
		}
		.save_btn {
			width: 700rpx;
			height: 80rpx;
			background: #41AF36;
			border-radius: 50rpx;
			font-size: 30rpx;
			font-weight: 500;
			color: #fff;
			text-align: center;
			line-height: 80rpx;
			position: fixed;
			bottom: 32rpx;
			left: 25rpx;
		}
	}
	.list {
		padding: 20rpx 20rpx 0;
		.list_item {
			background: #fff;
			border-radius: 10rpx;
			margin-bottom: 20rpx;
			padding: 30rpx 20rpx;
			.return_price {
				.return_price_1 {
					font-weight: 700;
					font-size: 30rpx;
					color: #3D3D3D;
				}
				.return_price_2 {
					font-weight: 700;
					font-size: 30rpx;
					color: #D43C3B;
				}
			}
			.order_price {
				margin-top: 10rpx;
				padding-bottom: 20rpx;
				font-weight: 400;
				font-size: 24rpx;
				color: rgba(61,61,61,0.5);
				border-bottom: 1px solid rgba(0,0,0,0.1);
			}
			.return_shop {
				margin-top: 30rpx;
				.shop_price {
					width: 120rpx;
					height: 120rpx;
					border-radius: 8rpx;
					position: relative;
					.return_text {
						width: 120rpx;
						height: 36rpx;
						background: #41AF36;
						border-radius: 0px 0px 8px 8px;
						font-weight: 500;
						font-size: 22rpx;
						color: #FFFFFF;
						position: absolute;
						bottom: 0;
						left: 0;
					}
				}
				/deep/.u-lazy-item {
					width: 120rpx !important;
					height: 120rpx !important;
					border-radius: 8rpx !important;
				}
				.return_information {
					flex: 1;
					margin: 0 30rpx;
					.apply_time {
						font-weight: 400;
						font-size: 24rpx;
						color: rgba(61,61,61,0.5);
						margin-top: 10rpx;
					}
				}
				.details_btn {
					width: 120rpx;
					height: 50rpx;
					background: #41AF36;
					border-radius: 10rpx;
					font-size: 24rpx;
					color: #fff;
					transform: translateY(35rpx);
				}
			}
		}
	}
	
</style>